package com.bancomer.pig.functions;

import java.io.IOException;

import org.apache.pig.PigServer;

public class Test {
	
	
	public static void main(String[] args) {
		try {
		    PigServer pigServer = new PigServer("local");
		    runIdQuery(pigServer, "test.txt");
		    }
		    catch(Exception e) {
		    	
		    	e.printStackTrace();
		    }
		 }
		public static void runIdQuery(PigServer pigServer, String inputFile) throws Exception {
		   try{
			pigServer.registerQuery("A = load '" + inputFile + "' using PigStorage(':');");
		    pigServer.registerQuery("B = foreach A generate $0 as id;");
		    pigServer.registerQuery("DUMP A;");
		  //  pigServer.store("B", "id.out");
		     System.out.println("hola");
		     
		   }catch(Exception e) {
		    	
		    	e.printStackTrace();
		    }
		 }

}
